package main

import (
	"fmt"
	"interfacedemo/hls"
)

type Retiever interface {
	Get(url string)string
}

type Poster interface {
	Post(url string,form map[string]string) string
}

func download(r Retiever)string{
	return r.Get("http://www.baidu.com/")
}

const url  = "http://www.baidu.com/"
func post(poster Poster){
	poster.Post(url,map[string]string{
		"name":"huangliusong",
		"course":"godfdlangf" ,
	})
}

type RetrieverPoster interface {
	Retiever
	Poster
}

func session(s RetrieverPoster)string{
	s.Post(url,map[string]string{
		"contents":"wo shi h",

	})
	return s.Get(url)
}

func main()  {
	//var r Retiever
	retriever:=hls.HlsRetiever{"huangliusong"}
	//fmt.Printf("%T %v \n",r,r)
	//r=&hls.RealRetriever{"Mozilla/5.0",time.Minute}
	//fmt.Printf("%T %v \n",r,r)
	//fmt.Println(download(r))
	fmt.Println(session(&retriever))


}